//菜单管理
import request from '@/static/utils/request';

// 查询菜单列表
export function list(query) {
  return request({
    url: '/base/dict/data',
    method: 'get',
    params: query
  })
}
//获取所有字典类型
export function typeList(){
  return request({
    url: '/base/dict/type/list',
    method: 'get',
  })
}

//根据字典类型查询字典数据
export function getDataByType(type){
  return request({
    url:'/base/dict/data/'+type,
    method:'get',
  })
}

//删除字典数据
export function deleteDictData(id){
  return request({
    url:'/base/dict/data/'+id,
    method:'delete'
  })
}
//批量停用数据字典
export function doStopDictData(ids){
  return request({
    url:'/base/dict/data/stop/'+ids,
    method:'put'
  })
}
//批量启用数据字典
export function doStartDictData(ids){
  return request({
    url:'/base/dict/data/start/'+ids,
    method:'put',

  })
}
//添加字典数据
export function add(dict){
  return request({
    url:'/base/dict/data',
    method:'post',
    data: dict
  })
}
